package org.sgx.gwtsjcl.client;

import com.google.gwt.core.client.JavaScriptObject;

/**
 * parameters for encryption.
 * 
 * dump example:
 * 
 * <pre>
 * {iv: -958955549,-82075222,-717585952,1345364639, v: 1, iter: 1000, ks: 128, ts: 64, mode: ccm, adata: , cipher: aes, salt: -1533044888,18581980, key: 61489183,-1867235376,786301860,-30365063, }
 *    {iv object, v number, iter number, ks number, ts number, mode string, adata string, cipher string, salt object, key object, }
 * </pre>
 * 
 * @author sg
 * 
 */
public class EncryptParam extends JavaScriptObject {
	protected EncryptParam() {
	}

	public static native EncryptParam create() /*-{
		return {};
	}-*/;

	/**
	 * 
	 * @return
	 */
	public native final BitArrayType iv() /*-{
		return this["iv"];
	}-*/;

	/**
	 * 
	 * @param val
	 * @return this - for setter chaining
	 */
	public native final EncryptParam iv(BitArrayType val) /*-{
		this["iv"] = val;
		return this;
	}-*/;

	/**
	 * 
	 * @param val
	 * @return this - for setter chaining
	 */
	public native final EncryptParam iv(int[] val) /*-{
		this["iv"] = @org.sgx.gwtsjcl.client.JsUtil::toJsArrayInt([I)(val);
		return this;
	}-*/;

	/**
	 * 
	 * @return
	 */
	public native final int v() /*-{
		return this["v"];
	}-*/;

	/**
	 * 
	 * @param val
	 * @return this - for setter chaining
	 */
	public native final EncryptParam v(int val) /*-{
		this["v"] = val;
		return this;
	}-*/;

	/**
	 * 
	 * @return
	 */
	public native final int iter() /*-{
		return this["iter"];
	}-*/;

	/**
	 * 
	 * @param val
	 * @return this - for setter chaining
	 */
	public native final EncryptParam iter(int val) /*-{
		this["iter"] = val;
		return this;
	}-*/;

	/**
	 * 
	 * @return
	 */
	public native final int ks() /*-{
		return this["ks"];
	}-*/;

	/**
	 * 
	 * @param val
	 * @return this - for setter chaining
	 */
	public native final EncryptParam ks(int val) /*-{
		this["ks"] = val;
		return this;
	}-*/;

	/**
	 * 
	 * @return
	 */
	public native final int ts() /*-{
		return this["ts"];
	}-*/;

	/**
	 * 
	 * @param val
	 * @return this - for setter chaining
	 */
	public native final EncryptParam ts(int val) /*-{
		this["ts"] = val;
		return this;
	}-*/;

	/**
	 * 
	 * @return
	 */
	public native final String mode() /*-{
		return this["mode"];
	}-*/;

	/**
	 * 
	 * @param val
	 * @return this - for setter chaining
	 */
	public native final EncryptParam mode(String val) /*-{
		this["mode"] = val;
		return this;
	}-*/;

	/**
	 * 
	 * @return
	 */
	public native final String adata() /*-{
		return this["adata"];
	}-*/;

	/**
	 * 
	 * @param val
	 * @return this - for setter chaining
	 */
	public native final EncryptParam adata(String val) /*-{
		this["adata"] = val;
		return this;
	}-*/;

	/**
	 * 
	 * @return
	 */
	public native final String cipher() /*-{
		return this["cipher"];
	}-*/;

	/**
	 * 
	 * @param val
	 * @return this - for setter chaining
	 */
	public native final EncryptParam cipher(String val) /*-{
		this["cipher"] = val;
		return this;
	}-*/;

	/**
	 * 
	 * @return
	 */
	public native final BitArrayType salt() /*-{
		return this["salt"];
	}-*/;

	/**
	 * 
	 * @param val
	 * @return this - for setter chaining
	 */
	public native final EncryptParam salt(BitArrayType val) /*-{
		this["salt"] = val;
		return this;
	}-*/;

	/**
	 * 
	 * @param val
	 * @return this - for setter chaining
	 */
	public native final EncryptParam salt(int[] val) /*-{
		this["salt"] = @org.sgx.gwtsjcl.client.JsUtil::toJsArrayInt([I)(val);
		return this;
	}-*/;

	/**
	 * 
	 * @return
	 */
	public native final BitArrayType key() /*-{
		return this["key"];
	}-*/;

	/**
	 * 
	 * @param val
	 * @return this - for setter chaining
	 */
	public native final EncryptParam key(BitArrayType val) /*-{
		this["key"] = val;
		return this;
	}-*/;

	/**
	 * 
	 * @param val
	 * @return this - for setter chaining
	 */
	public native final EncryptParam key(int[] val) /*-{
		this["key"] = @org.sgx.gwtsjcl.client.JsUtil::toJsArrayInt([I)(val);
		return this;
	}-*/;
}
